package org.jyrcp.base;

public class TextUtils
{
	public static String shortenPackageName(String longPackageName)
	{
		int index = longPackageName.lastIndexOf(".") + 1;
		return longPackageName.substring(index);
	}

	public static String packageNameToClassName(String packageName)
	{
		String[] parts = packageName.split("_");
		StringBuffer result = new StringBuffer();

		for (int i = 0; i < parts.length; i++)
		{
			result.append(parts[i].substring(0, 1).toUpperCase());
			result.append(parts[i].substring(1).toLowerCase());
		}

		return result.toString();
	}
}
